﻿using OA.Migrations;
using System.Data.Entity;

namespace OA.Models
{
    public class OAContext : DbContext
    {
        // You can add custom code to this file. Changes will not be overwritten.
        // 
        // If you want Entity Framework to drop and regenerate your database
        // automatically whenever you change your model schema, please use data migrations.
        // For more information refer to the documentation:
        // http://msdn.microsoft.com/en-us/data/jj591621.aspx
    
        public OAContext() : base("name=OAContext")
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<OAContext, Configuration>()); 
        }

        public DbSet<File> Files { get; set; }

        public DbSet<Account> Accounts { get; set; }
        public DbSet<Menu> Menus { get; set; }
        public DbSet<MenuItem> MenuItems { get; set; }

        public DbSet<Department> Departments { get; set; }
        public DbSet<Post> Posts { get; set; }
        
        #region 申请单

        //public DbSet<ApplicationAgent> ApplicationAgent { get; set; }
        //public DbSet<ApproveNode> ApproveNode { get; set; }
        //public DbSet<DefaultNext> DefaultNext { get; set; }

        public DbSet<调班申请单> 调班申请单 { get; set; }
        public DbSet<请假申请表> 请假申请表 { get; set; }
        public DbSet<借据> 借据 { get; set; }

        #endregion
    }
}
